package com.memorypalace.pojo;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.Gson;
import com.memorypalace.deck.vo.DeckNoteNoteTypeCardStyleCard;
import com.memorypalace.deck.vo.ScreenConditions;

public class StudyList {
	private String studyListId;//学习列表Id  主键
	private String userId;//用户Id 外键
	private String studySchemeId;//学习方案列表Id
	private String studyListName;//学习列表名称
	private String sortCondition;//排序条件        t_sort
	private ScreenConditions screenConditions;//筛选条件
	private String screenConditions_json; //筛选条件
	private Integer oldCard;
	private Integer newCard;
	private List<DeckNoteNoteTypeCardStyleCard> newCardList;
	private List<DeckNoteNoteTypeCardStyleCard> reviewCardList;
	
	
	private StudyScheme studyScheme;
	


	


	public Integer getOldCard() {
		return oldCard;
	}

	public void setOldCard(Integer oldCard) {
		this.oldCard = oldCard;
	}

	public Integer getNewCard() {
		return newCard;
	}

	public void setNewCard(Integer newCard) {
		this.newCard = newCard;
	}

	public ScreenConditions getScreenConditions() {
		return screenConditions;
	}

	public StudyList(String studyListId){
		this.studyListId = studyListId;
	}



	public StudyList( String studyListName, String screenConditions_json) {
		super();
		
		this.studyListName = studyListName;
		this.screenConditions_json = screenConditions_json;
	}



	public void setScreenConditions(ScreenConditions screenConditions) {
		this.screenConditions = screenConditions;
		Gson gson = new Gson();
		this.screenConditions_json = gson.toJson(screenConditions);
	}



	public void setScreenConditions_json(String screenConditions_json) {
		this.screenConditions_json = screenConditions_json;
		Gson gson = new Gson();
		this.screenConditions = gson.fromJson(screenConditions_json, ScreenConditions.class);
		if(screenConditions.getCardNextStudyTime() != null){
			screenConditions.setCardNextStudyTime(screenConditions.getCardNextStudyTime());
		}
		if(screenConditions.getNoteCreateTime() != null){
			screenConditions.setNoteCreateTime(screenConditions.getNoteCreateTime());
		}
		if(screenConditions.getNoteEditTime() != null){
			screenConditions.setNoteEditTime(screenConditions.getNoteEditTime());
		}
	}



	public StudyList(){
		
	}
	
	
	
	public StudyList(String studyListId, String userId, String studySchemeId, String studyListName,
			String sortCondition) {
		super();
		this.studyListId = studyListId;
		this.userId = userId;
		this.studySchemeId = studySchemeId;
		this.studyListName = studyListName;
		this.sortCondition = sortCondition;
	}



	public String getStudyListId() {
		return studyListId;
	}
	public void setStudyListId(String studyListId) {
		this.studyListId = studyListId;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getStudySchemeId() {
		return studySchemeId;
	}
	public void setStudySchemeId(String studySchemeId) {
		this.studySchemeId = studySchemeId;
	}

	public String getStudyListName() {
		return studyListName;
	}




	public void setStudyListName(String studyListName) {
		this.studyListName = studyListName;
	}



	public String getSortCondition() {
		return sortCondition;
	}
	public void setSortCondition(String sortCondition) {
		this.sortCondition = sortCondition;
	}

	@Override
	public String toString() {
		return "StudyList [studyListId=" + studyListId + ", userId=" + userId + ", studySchemeId=" + studySchemeId
				+ ", studyListName=" + studyListName + ", sortCondition=" + sortCondition + ", screenConditions="
				+ screenConditions + ", screenConditions_json=" + screenConditions_json + ", oldCard=" + oldCard
				+ ", newCard=" + newCard + "]";
	}

	public StudyScheme getStudyScheme() {
		return studyScheme;
	}

	public void setStudyScheme(StudyScheme studyScheme) {
		this.studyScheme = studyScheme;
	}

	public List<DeckNoteNoteTypeCardStyleCard> getNewCardList() {
		return newCardList;
	}

	public void setNewCardList(List<DeckNoteNoteTypeCardStyleCard> newCardList) {
		this.newCardList = newCardList;
	}

	public List<DeckNoteNoteTypeCardStyleCard> getReviewCardList() {
		return reviewCardList;
	}

	public void setReviewCardList(List<DeckNoteNoteTypeCardStyleCard> reviewCardList) {
		this.reviewCardList = reviewCardList;
	}


	
}
